package algorithm.lanqiao.t17153;

import java.io.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;


public class Main {
    static InputStreamReader ins = new InputStreamReader(System.in);
    static BufferedReader br = new BufferedReader(ins);
    static StreamTokenizer in = new StreamTokenizer(ins);
    static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) {
        int n = readInt();
        int count1 = 0, count2 = 0;
        Map<Integer, Integer> map = new HashMap<>();
        String str = readLine();
        Arrays.stream(str.split(" ")).map(Integer::parseInt).forEach(i -> {
            map.put(i, map.getOrDefault(i, 0) + 1);
        });
        Collection<Integer> values = map.values();
        for (Integer i : values) {
            if (i == 1) {
                count1++;
            } else if (i > 2) {
                count2 += i - 2;
            }
        }
        int ans = 0;
        if (count1 > count2) {
            ans += count2;
            ans += (count1 - count2) / 2;
        } else {
            ans += count2;
        }
        out.println(ans);
        out.flush();
    }


    private static String readLine() {
        String s = null;
        try {
            s = br.readLine();
        } catch (IOException e) {

        }
        return s;
    }

    private static int readInt() {
        try {
            in.nextToken();
        } catch (Exception e) {
        }

        return (int) in.nval;
    }
}
